# @time     :2022/2/19
# @Author   :Simple
# @FileName :setting
import logging
import os


def init_dir(path, file_name):
    """
    初始化目录
    """
    if not os.path.exists(os.path.join(path, file_name)):
        os.mkdir(os.path.join(path, file_name))
    return os.path.join(path, file_name)


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOG_DIR = init_dir(BASE_DIR, 'logs')
RUN_LOG = init_dir(LOG_DIR, "run")
REPORT_DIR = init_dir(BASE_DIR, "report")
IMAGE_REPORT = init_dir(REPORT_DIR, "image")
CONFIG_DIR = init_dir(BASE_DIR, "setting")
API_DIR = init_dir(BASE_DIR, "api")
CONFIG_ = os.path.join(CONFIG_DIR, 'config_token.yml')
# 日志类型
log_level = logging.DEBUG
# 测试用例数据存放路径
cases_path = os.path.join(BASE_DIR, "testcase/")
# 需要抓取请求的部分url
api_url = "https://qyapi.weixin.qq.com/cgi-bin/department/create"
# api类的模板
api_class_template = os.path.join(CONFIG_DIR, "api_class_template.txt")
# 请求yaml文件模板
api_yaml_template = os.path.join(CONFIG_DIR, "api_yaml.txt")

